package com.laicunba.service.activity.conditionimpl;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.laicunba.service.activity.ActivityConditionCheckService;
import com.laicunba.util.StringUtil;

@Service
public class ActivityConditionCheckServiceBankBidAmtMoreImpl extends ActivityConditionCheckServiceBaseImpl implements ActivityConditionCheckService {

	@Override
	public String getType() {
		return "bank_bid_amt_more";
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public boolean check(String uid, Object param) {
		String[] p = ((String) param).split("[,]");
		if (p.length != 3) {
			return false;
		}
		Map map = new HashMap();
		map.put("uid", uid);
		map.put("beginDate", p[0]);
		map.put("endDate", p[1]);
		map.put("amt", BigDecimal.valueOf(Double.parseDouble(p[2])));
		return queryDao.selectOne("ACTIVITY_CONDITION_CHECK.bank_bid_amt_more", map);
	}

}
